#define _CRT_SECURE_NO_WARNINGS 1


#include<iostream>

using namespace std;

int Func(long long n)
{
	int sum = 0;

	while (n)
	{
		sum += n % 10;
		n /= 10;
	}

	return sum;
}

int main()
{
	long long n = 0;
	for (int i = 0; i < 3; i++)
	{
		cin >> n;
		cout << Func(n) << endl;
	}

	return 0;
}